//
//  SunGesChangeVC.m
//  Xspcf
//
//  Created by sunshine on 16/11/17.
//  Copyright © 2016年 小小算盘. All rights reserved.
//

#import "SunGesChangeVC.h"
#import "SunGesSetVC.h"
#import "PCCircleView.h"
#import "PCCircleViewConst.h"
#import "PCLockLabel.h"
#import "PCCircleInfoView.h"
#import "PCCircle.h"

@interface SunGesChangeVC ()<CircleViewDelegate>
{
    PCCircleView *_lockView;
    PCLockLabel *_msgLabel;
}
@end

@implementation SunGesChangeVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = BACKGROUND;
    self.title = @"验证手势解锁";
    [self creatUI];
    // Do any additional setup after loading the view.
}

- (void)creatUI{
    _msgLabel = [[PCLockLabel alloc] init];
    [_msgLabel showNormalMsg:gestureTextOldGesture];
    [self.view addSubview:_msgLabel];
    [_msgLabel lt_setTop:Y(75) to:nil save:YES];
    [_msgLabel lt_XcenterTo:nil save:YES];
    _lockView = [[PCCircleView alloc] init];
    [self.view addSubview:_lockView];
    _lockView.delegate = self;
    [_lockView lt_XcenterTo:nil save:YES];
    [_lockView lt_setTop:Y(130) to:nil save:YES];
    [_lockView lt_setSize:CGSizeMake(X(270), X(270)) save:YES];
    _lockView.type = CircleViewTypeVerify;
}

#pragma mark - login or verify gesture
- (void)circleView:(PCCircleView *)view type:(CircleViewType)type didCompleteLoginGesture:(NSString *)gesture result:(BOOL)equal
{
    if (equal) {
        SunGesSetVC *vc = [[SunGesSetVC alloc] init];
        [self.navigationController pushViewController:vc animated:YES];
    } else {
        [_msgLabel showWarnMsgAndShake:gestureTextGestureVerifyError];
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
